package spec.lijunyao.unit4.outclazz.animal1;
/**
*青蛙类
 * 子类如果继承了抽象类，就必须实现抽象类里的抽象方法
 * 类如果实现了接口就必须实现接口里定义的所有方法
 *
 */
public class Frog extends Animal implements  IAnimal{
    //成员属性
    String liangQi;
    //构造方法
    Frog(String name,String food,String area,String liangQi){
        super.name =name;
        super.food=food;
        super.area=area;
        this.liangQi =liangQi;
    }
    //成员方法
    @Override
    String findFood(){
        return name +"找"+food;
    }
    @Override
    String wholeLife(){
        return this.die()+this.born()+this.old()+this.sick()+this.name()+this.food()+this.area();
    }
   public String born(){
        return  "生于";
    }

    @Override
    public String old() {
        return "变老";
    }

    @Override
    public String sick() {
        return "生病";
    }

    @Override
    public String die() {
        return "死亡";
    }

    public String name(){
       return "青蛙";
    }
    public String food(){
        return "田鸡";
    }
    public String area(){
        return "田野";
    }
}
